package com.container.app;

import com.cache.app.exceptions.NoSuchElementInCacheException;
import com.container.app.exceptions.MContainerUncheckedException;
import com.container.app.proxy.ContainerProxyHandler;
import com.container.app.utilities.ObjectType;
import com.container.app.utilities.Pair;

import java.lang.annotation.IncompleteAnnotationException;
import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: Georgiana.Scarlat
 * Date: 8/3/12
 * Time: 9:46 AM
 */
public interface MContainer {

    public void runContainer(String propertyFileName) throws MContainerUncheckedException;

    @SuppressWarnings("UnusedDeclaration")
    public void runContainerScan(String propertyFileName) throws MContainerUncheckedException, IncompleteAnnotationException;

    public <T> T getInstance(Class cls) throws MContainerUncheckedException;

    public <T> T getInstance(String componentName)  throws MContainerUncheckedException;

    public void runContainerOnPackage(String packageName) throws MContainerUncheckedException;

    public void scanPackage(String packageName) throws MContainerUncheckedException, IncompleteAnnotationException;

    public <T> void resolveDependencies(T instance, ObjectType type) throws MContainerUncheckedException;

    public void setWithProxies(boolean withProxies, Class<? extends ContainerProxyHandler> proxyHandler) throws MContainerUncheckedException;

    public void addMappingToCache(Pair<Pair<Class, Pair<Class, String>>, Object> interface_annotation_implementationAssociation);

    public void closeContainer();

    public boolean containsMappings(List<Pair<Pair<Class, Pair<Class, String>>, Object>> expectedMappings) throws NoSuchElementInCacheException;
}
